#ifndef RULES_H
#define RULES_H
#include "fw4.h"
#include "network.h"
#include <linux/inet.h>

#define NUM_OF_DEF_RULES 4		// number of pre defined rules
#define NUM_OF_PROTOCOLS 3		// number of protocols
#define LAST_RULE_PROT 255		// end protocol
#define UNMATCHED_PACKET -1		// no rule was found


/*
 * function  checkPermission:
 * checks if the rules allow or deny conversation
 * between specific clientIP and serverIP
 * between specific clientIP and serverIP
 * params		: full rules matrix, clientID, serverID
 * return value : VERDICT_ALLOW - if allowed, VERDICT_DROP - otherwise
 * assumptions  : call is made after a call to LoadRules, 
 * 				  clientID and serverID are at range 0-255   
 */
static char checkPermission(rawPacket_t* packet, int *matchedIndex);

/*
 * function loadDeafultRules
 * loads the pre defined rules
 * assumptions: should be called before any rules is added and after allocation of rules array
 */ 
static void loadDefaultRules(void);

#endif

